<script type="text/javascript">
var _d = DialogManager.get('config_dialog');
_d.setWidth(540);
_d.setPosition('center');
$(function(){
	$("select[name='img_recom_id_1']").change(function(){
		switchRecommend(this.value, 'img_cate_id_1');
	});
	$("select[name='img_recom_id_2']").change(function(){
		switchRecommend(this.value, 'img_cate_id_2');
	});
	$("select[name='img_recom_id_3']").change(function(){
		switchRecommend(this.value, 'img_cate_id_3');
	});
	$("select[name='img_recom_id_4']").change(function(){
		switchRecommend(this.value, 'img_cate_id_4');
	});
	$("select[name='img_recom_id_5']").change(function(){
		switchRecommend(this.value, 'img_cate_id_5');
	});

	switchRecommend($("select[name='img_recom_id_1']").val(), 'img_cate_id_1');
	switchRecommend($("select[name='img_recom_id_2']").val(), 'img_cate_id_2');
	switchRecommend($("select[name='img_recom_id_3']").val(), 'img_cate_id_3');
	switchRecommend($("select[name='img_recom_id_4']").val(), 'img_cate_id_4');
	switchRecommend($("select[name='img_recom_id_5']").val(), 'img_cate_id_5');
});

function switchRecommend(recomId, selectName)
{
    if (recomId >= 0)
    {
        $("select[name='" + selectName + "']").hide();
    }
    else
    {
        $("select[name='" + selectName + "']").show();
    }
}
	
function loadImage(obj){
    getTempPath(obj,function(res){
        $(obj).parent().find('img').attr('src',res);
    });
}
</script>
<div class="field_item webkit-box">
    <label>模块名称</label>
    <p><input type="text" name="model_name" value="{$options.model_name}" /></p>
</div>
<div class="field_item webkit-box">
    <label>风格颜色</label>
    <p>
    	<select name="model_style">
        	<option>请选择模块风格</option>
        	<option {if $options.model_style eq 'kafei'} selected="selected"{/if} value="kafei">风格一（咖啡色）</option>
            <option {if $options.model_style eq 'cheng'} selected="selected"{/if} value="cheng">风格二（橙色）</option>
        	<option {if $options.model_style eq 'qing'} selected="selected"{/if} value="qing">风格三（青色）</option>
            <option {if $options.model_style eq 'danzi'} selected="selected"{/if} value="danzi">风格四（淡紫色）</option>
            <option {if $options.model_style eq 'danh'} selected="selected"{/if} value="danh">风格五（淡红色）</option>
            <option {if $options.model_style eq 'lan'} selected="selected"{/if} value="lan">风格六（蓝色）</option>
            <option {if $options.model_style eq 'tao'} selected="selected"{/if} value="tao">风格七（桃色）</option>
            <option {if $options.model_style eq 'qianlan'} selected="selected"{/if} value="qianlan">风格八（浅蓝色）</option>
            <option {if $options.model_style eq 'fenhong'} selected="selected"{/if} value="fenhong">风格八（粉红色）</option>
        </select>
    </p>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>左侧广告1</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad1_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad1_image_url" value="{$options.ad1_image_url}" />
        <img src="{if $options.ad1_image_url}{$options.ad1_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*570px</font>
</div>
<div class="field_item webkit-box">
    <label>广告1链接</label>
    <p><input type="text" name="ad1_link_url" value="{$options.ad1_link_url}" /></p>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>左侧广告2</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad2_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad2_image_url" value="{$options.ad2_image_url}" />
        <img src="{if $options.ad2_image_url}{$options.ad2_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*570px</font>
</div>
<div class="field_item webkit-box">
    <label>广告2链接</label>
    <p><input type="text" name="ad2_link_url" value="{$options.ad2_link_url}" /></p>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>左侧广告3</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad3_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad3_image_url" value="{$options.ad3_image_url}" />
        <img src="{if $options.ad3_image_url}{$options.ad3_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*570px</font>
</div>
<div class="field_item webkit-box">
    <label>广告3链接</label>
    <p><input type="text" name="ad3_link_url" value="{$options.ad3_link_url}" /></p>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>中间广告1</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad4_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad4_image_url" value="{$options.ad4_image_url}" />
        <img src="{if $options.ad4_image_url}{$options.ad4_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*280px</font>
</div>
<div class="field_item webkit-box">   
    <label>链接地址</label>
    <p><input type="text" name="ad4_link_url" value="{$options.ad4_link_url}" /></p>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>中间广告2</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad5_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad5_image_url" value="{$options.ad5_image_url}" />
        <img src="{if $options.ad5_image_url}{$options.ad5_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*280px</font>
</div>
<div class="field_item webkit-box">
    <label>链接地址</label>
    <p><input type="text" name="ad5_link_url" value="{$options.ad5_link_url}" /></p>
</div>

<div class="field_item webkit-box">
    <label>切换1标题</label>
    <p><input type="text" name="tab1_title" value="{$options.tab1_title}" /></p>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>切换1广告1</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad6_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad6_image_url" value="{$options.ad6_image_url}" />
        <img src="{if $options.ad6_image_url}{$options.ad6_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*280px</font>
</div>
<div class="field_item webkit-box">    
    <label>链接地址</label>
    <p><input type="text" name="ad6_link_url" value="{$options.ad6_link_url}" /></p>
</div>
<div class="field_item webkit-box box-align-center">   
    <label>广告标题</label>
    <p><input type="text" name="model6_title" value="{$options.model6_title}" /></p>
    <font class="ml10 fs12" color="gray">大小标题用“|”隔开</font>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>切换1广告2</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad7_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad7_image_url" value="{$options.ad7_image_url}" />
        <img src="{if $options.ad7_image_url}{$options.ad7_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*280px</font>
</div>
<div class="field_item webkit-box">    
    <label>链接地址</label>
    <p><input type="text" name="ad7_link_url" value="{$options.ad7_link_url}" /></p>
</div>
<div class="field_item webkit-box box-align-center">   
    <label>广告标题</label>
    <p><input type="text" name="model7_title" value="{$options.model7_title}" /></p>
    <font class="ml10 fs12" color="gray">大小标题用“|”隔开</font>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>切换1广告3</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad8_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad8_image_url" value="{$options.ad8_image_url}" />
        <img src="{if $options.ad8_image_url}{$options.ad8_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*280px</font>
</div>
<div class="field_item webkit-box">    
    <label>链接地址</label>
    <p><input type="text" name="ad8_link_url" value="{$options.ad8_link_url}" /></p>
</div>
<div class="field_item webkit-box box-align-center">    
    <label>广告标题</label>
    <p><input type="text" name="model8_title" value="{$options.model8_title}" /></p>
    <font class="ml10 fs12" color="gray">大小标题用“|”隔开</font>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>切换1广告4</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad9_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad9_image_url" value="{$options.ad9_image_url}" />
        <img src="{if $options.ad9_image_url}{$options.ad9_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*280px</font>
</div>
<div class="field_item webkit-box">
    <label>链接地址</label>
    <p><input type="text" name="ad9_link_url" value="{$options.ad9_link_url}" /></p>
</div>
<div class="field_item webkit-box box-align-center">    
    <label>广告标题</label>
    <p><input type="text" name="model9_title" value="{$options.model9_title}" /></p>
    <font class="ml10 fs12" color="gray">大小标题用“|”隔开</font>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>切换1广告5</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad10_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad10_image_url" value="{$options.ad10_image_url}" />
        <img src="{if $options.ad10_image_url}{$options.ad10_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*280px</font>
</div>
<div class="field_item webkit-box">    
    <label>链接地址</label>
    <p><input type="text" name="ad10_link_url" value="{$options.ad10_link_url}" /></p>
</div>
<div class="field_item webkit-box box-align-center">    
    <label>广告标题</label>
    <p><input type="text" name="model10_title" value="{$options.model10_title}" /></p>
    <font class="ml10 fs12" color="gray">大小标题用“|”隔开</font>
</div>
<div class="field_item webkit-box file-box box-align-center">
    <label>切换1广告6</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad11_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad11_image_url" value="{$options.ad11_image_url}" />
        <img src="{if $options.ad11_image_url}{$options.ad11_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传，图片尺寸：232*280px</font>
</div>
<div class="field_item webkit-box">   
    <label>链接地址</label>
    <p><input type="text" name="ad11_link_url" value="{$options.ad11_link_url}" /></p>
</div>
<div class="field_item webkit-box box-align-center">    
    <label>广告标题</label>
    <p><input type="text" name="model11_title" value="{$options.model11_title}" /></p>
    <font class="ml10 fs12" color="gray">大小标题用“|”隔开</font>
</div>
<div class="field_item webkit-box">
    <label>切换2标题</label>
    <p><input type="text" name="tab2_title" value="{$options.tab2_title}" /></p>
</div>
<div class="field_item webkit-box">    
    <label>切换2商品</label>
    <p><select name="img_recom_id_2">
        <option value="0">请选择...</option>
        <!-- {foreach from=$recommends key=recom_id item=recom_name} -->
        <option value="{$recom_id}"{if $options.img_recom_id_2 eq $recom_id} selected="selected"{/if}>{$recom_name|escape}</option>
        <!-- {/foreach} -->
    </select>
    <select name="img_cate_id_2">
        <option value="0">请选择分类...</option>
        {html_options options=$gcategories selected=$options.img_cate_id_2}
    </select></p>
</div>
<div class="field_item webkit-box">    
    <label>切换3标题</label>
    <p><input type="text" name="tab3_title" value="{$options.tab3_title}" /></p>
</div>
<div class="field_item webkit-box">    
    <label>切换3商品</label>
    <p><select name="img_recom_id_3">
        <option value="0">请选择...</option>
        <!-- {foreach from=$recommends key=recom_id item=recom_name} -->
        <option value="{$recom_id}"{if $options.img_recom_id_3 eq $recom_id} selected="selected"{/if}>{$recom_name|escape}</option>
        <!-- {/foreach} -->
    </select>
    <select name="img_cate_id_3">
        <option value="0">请选择分类...</option>
        {html_options options=$gcategories selected=$options.img_cate_id_3}
    </select></p>
</div>
<div class="field_item webkit-box">   
    <label>切换4标题</label>
    <p><input type="text" name="tab4_title" value="{$options.tab4_title}" /></p>
</div>
<div class="field_item webkit-box">    
    <label>切换4商品</label>
    <p><select name="img_recom_id_4">
        <option value="0">请选择...</option>
        <!-- {foreach from=$recommends key=recom_id item=recom_name} -->
        <option value="{$recom_id}"{if $options.img_recom_id_4 eq $recom_id} selected="selected"{/if}>{$recom_name|escape}</option>
        <!-- {/foreach} -->
    </select>
    <select name="img_cate_id_4">
        <option value="0">请选择分类...</option>
        {html_options options=$gcategories selected=$options.img_cate_id_4}
    </select></p>
</div>
<div class="field_item webkit-box">    
    <label>切换5标题</label>
    <p><input type="text" name="tab5_title" value="{$options.tab5_title}" /></p>
</div>
<div class="field_item webkit-box">    
    <label>切换5商品</label>
    <p><select name="img_recom_id_5">
        <option value="0">请选择...</option>
        <!-- {foreach from=$recommends key=recom_id item=recom_name} -->
        <option value="{$recom_id}"{if $options.img_recom_id_5 eq $recom_id} selected="selected"{/if}>{$recom_name|escape}</option>
        <!-- {/foreach} -->
    </select>
    <select name="img_cate_id_5">
        <option value="0">请选择分类...</option>
        {html_options options=$gcategories selected=$options.img_cate_id_5}
    </select></p> 
</div>
     




